# Contributor: Michał Polański <michal@polanski.me>
# Contributor: Daniel Isaksen <d@duniel.no>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=elvish
pkgver=0.21.0
pkgrel=1
pkgdesc="Friendly and expressive Unix shell"
url="https://elv.sh/"
arch="all"
license="BSD-2-Clause"
makedepends="go"
source="https://github.com/elves/elvish/archive/v$pkgver/elvish-$pkgver.tar.gz
	s390x-atan2-test.patch
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOFLAGS="$GOFLAGS -mod=readonly"

build() {
	go build -ldflags="
		-X src.elv.sh/pkg/buildinfo.Variant=alpine$pkgrel
	" ./cmd/elvish
}

check() {
	go test ./...
}

package() {
	install -Dm755 elvish -t "$pkgdir"/usr/bin/
}

sha512sums="
6bc9c53d77c43d067f42c52591db92812bfedbf7b2658d394d08bfd9d2b496fe0afa78548c5083070c2fdd150cc7ef7173d84d3a3be94893ef54609f0572418f  elvish-0.21.0.tar.gz
c0211797058660245fe62699d9fc29fd71b3b79799c46e5edcd6d9cfca725d764e7f72184599c8fcbcfb6c18120a929f16f096f8c71cc0c4d881cc1b90e82169  s390x-atan2-test.patch
"
